3.1.15 \(\int \sin (c+d x) (a+b \tan (c+d x)) \, dx\) [15]

Optimal. Leaf size=37 \[ \frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cos (c+d x)}{d}-\frac {b \sin (c+d x)}{d} \]

[Out]

b*arctanh(sin(d*x+c))/d-a*cos(d*x+c)/d-b*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {3598, 2718, 2672, 327, 212} \begin {gather*} -\frac {a \cos (c+d x)}{d}-\frac {b \sin (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]*(a + b*Tan[c + d*x]),x]

[Out]

(b*ArcTanh[Sin[c + d*x]])/d - (a*Cos[c + d*x])/d - (b*Sin[c + d*x])/d

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3598

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Expand[Sin[e
+ f*x]^m*(a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int \sin (c+d x) (a+b \tan (c+d x)) \, dx &=\int (a \sin (c+d x)+b \sin (c+d x) \tan (c+d x)) \, dx\\ &=a \int \sin (c+d x) \, dx+b \int \sin (c+d x) \tan (c+d x) \, dx\\ &=-\frac {a \cos (c+d x)}{d}+\frac {b \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=-\frac {a \cos (c+d x)}{d}-\frac {b \sin (c+d x)}{d}+\frac {b \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cos (c+d x)}{d}-\frac {b \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 48, normalized size = 1.30 \begin {gather*} \frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cos (c) \cos (d x)}{d}+\frac {a \sin (c) \sin (d x)}{d}-\frac {b \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]*(a + b*Tan[c + d*x]),x]

[Out]

(b*ArcTanh[Sin[c + d*x]])/d - (a*Cos[c]*Cos[d*x])/d + (a*Sin[c]*Sin[d*x])/d - (b*Sin[c + d*x])/d

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 40, normalized size = 1.08

method result size
derivativedivides \(\frac {-a \cos \left (d x +c \right )+b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(40\)
default \(\frac {-a \cos \left (d x +c \right )+b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(40\)
risch \(\frac {i {\mathrm e}^{i \left (d x +c \right )} b}{2 d}-\frac {{\mathrm e}^{i \left (d x +c \right )} a}{2 d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} b}{2 d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a}{2 d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(101\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)*(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-a*cos(d*x+c)+b*(-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.33, size = 46, normalized size = 1.24 \begin {gather*} \frac {b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - 2 \, a \cos \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)) - 2*a*cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 49, normalized size = 1.32 \begin {gather*} -\frac {2 \, a \cos \left (d x + c\right ) - b \log \left (\sin \left (d x + c\right ) + 1\right ) + b \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, b \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(2*a*cos(d*x + c) - b*log(sin(d*x + c) + 1) + b*log(-sin(d*x + c) + 1) + 2*b*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d x \right )}\right ) \sin {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*sin(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1236 vs. \(2 (37) = 74\).
time = 0.53, size = 1236, normalized size = 33.41 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan
(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^
2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2*tan(1/2*c)^2 - b*log(
2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(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*c)
+ 2*a)/(d*tan(1/2*d*x)^2*tan(1/2*c)^2 + d*tan(1/2*d*x)^2 + d*tan(1/2*c)^2 + d)

________________________________________________________________________________________

Mupad [B]
time = 3.82, size = 53, normalized size = 1.43 \begin {gather*} \frac {2\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,a+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)*(a + b*tan(c + d*x)),x)

[Out]

(2*b*atanh(tan(c/2 + (d*x)/2)))/d - (2*a + 2*b*tan(c/2 + (d*x)/2))/(d*(tan(c/2 + (d*x)/2)^2 + 1))

________________________________________________________________________________________